Skip to content

Jon's agent skills, rules, and scripts#1

Open
j0ntz wants to merge 19 commits intomainfrom
jon
Open

Jon's agent skills, rules, and scripts#1
j0ntz wants to merge 19 commits intomainfrom
jon

Conversation

@j0ntz
Copy link
Copy Markdown
Contributor

@j0ntz j0ntz commented Mar 24, 2026

edge-dev-agents

Complete agent-assisted development workflow for Edge repositories:
slash skills, companion scripts, coding standards, review standards,
and meta-tooling for maintaining the workflow itself.

The distributable Cursor content lives under .cursor/. This repo is the
versioned home for those skills, rules, scripts, and docs.

The canonical local doc lives at ~/.cursor/README.md. During
/convention-sync, that file is mirrored to edge-dev-agents/README.md, and
the repo copy should not keep a second .cursor/README.md.

Installation

1. Set the required env var in your ~/.zshrc:

export GIT_BRANCH_PREFIX=yourname   # e.g. jon, paul, sam

This drives branch naming and PR discovery across the workflow.

2. Sync the repo copy into ~/.cursor/:

This repo treats ~/.cursor/ as the canonical working copy. Use
/convention-sync to move local changes into edge-dev-agents, or run the
companion script directly when onboarding:

~/.cursor/skills/convention-sync/scripts/convention-sync.sh \
  --repo-to-user --stage

3. Verify prerequisites:

  • gh CLI: gh auth login
  • jq: brew install jq
  • ASANA_TOKEN env var for Asana-backed workflows

Table of Contents

Architecture

edge-dev-agents/
├── README.md          # Synced copy of ~/.cursor/README.md
└── .cursor/
    ├── skills/        # Slash skills (*/SKILL.md) + companion scripts
    ├── scripts/       # Shared portability and dashboard scripts
    ├── commands/      # Minimal command wrappers
    └── rules/         # Coding and workflow standards (.mdc)

Separation of concerns:

  • Skills (SKILL.md) define workflows, rules, and step ordering.
  • Companion scripts (.sh, .js) handle deterministic work like git,
    GitHub, Asana, and JSON processing.
  • Rules (.mdc) provide persistent guidance that gets loaded by context.
  • Repo docs describe the system and how the distribution copy fits
    together.

All GitHub API work uses gh CLI. Deterministic git operations should live in
scripts, not be re-described independently across skills.

Skills (Slash Skills)

Core Implementation

Skill Description
/im Implement an Asana task or ad-hoc feature/fix with clean, structured commits
/one-shot Legacy-style task-to-PR flow built from planning, implementation, and PR creation
/pr-create Create a PR from the current branch with repo-aligned title and body
/dep-pr Create dependent Asana tasks and downstream PR work in another repo
/changelog Update CHANGELOG entries using repo conventions

Planning and Context

Skill Description
/asana-plan Build an implementation plan from Asana or ad-hoc requirements
/task-review Fetch and summarize Asana task context
/q Answer questions before taking action

Review and Landing

Skill Description
/pr-review Review a PR against coding and review standards
/pr-address Address PR feedback with fixup commits, replies, and optional autosquash
/pr-land Land approved PRs, including prepare, merge, publish, GUI dep updates, staging cherry-picks, and Asana updates
/staging-cherry-pick Cherry-pick landed staging-targeted commits onto the staging branch

Asana and Utility

Skill Description
/asana-task-update Generic Asana mutations such as attach PR, assign, unassign, and status updates
/standup Generate daily standup notes from Asana and GitHub activity
/chat-audit Audit Cursor chat sessions for waste, drift, and workflow gaps
/convention-sync Sync ~/.cursor/ with this repo, mirror the local README to repo root, and update PR descriptions from README.md
/author Create, revise, and debug skills, scripts, and rules
/fix-eslint Apply documented fixes for recurring Edge React GUI ESLint warnings

Companion Scripts

PR Operations

Script What it does API
pr-create.sh Create a PR for the current branch with standardized body formatting gh pr create
pr-address.sh Fetch unresolved feedback, reply, resolve threads, and mark items addressed gh api REST + GraphQL
github-pr-review.sh Fetch PR context and submit reviews gh pr view + gh api
github-pr-activity.sh Gather recent PR activity and CI context for standups gh api graphql

PR Landing Pipeline (/pr-land)

Script Phase What it does
pr-land-discover.sh Discovery Find relevant PRs and approval state
pr-land-comments.sh Comment check Detect unresolved inline, review-body, and top-level comments
git-branch-ops.sh Shared git ops Run deterministic autosquash and push operations for multiple skills
pr-land-prepare.sh Prepare Autosquash, rebase, detect conflicts, and verify
pr-land-merge.sh Merge Rebase again, verify, and merge sequentially
pr-land-publish.sh Publish Version bump, changelog update, commit, and tag
pr-land-extract-asana-task.sh Asana extraction Pull task IDs from landed PR metadata
upgrade-dep.sh GUI deps Bump one package on the current branch, run yarn/prepare, commit lockfile updates. Caller must sync develop first.
staging-cherry-pick.sh Staging Cherry-pick staging-qualified commits onto staging
verify-repo.sh Verification Run changelog and code verification

Build, Lint, and Analysis

Script What it does
lint-commit.sh Run lint-assisted commits and autosquash fixups through the shared git helper
lint-warnings.sh Auto-fix and summarize remaining TypeScript/ESLint warnings
install-deps.sh Install dependencies and run project prepare steps
cursor-chat-extract.js Parse Cursor chat exports into structured summaries

Asana and Portability

Script What it does
asana-get-context.sh Fetch task details, comments, subtasks, and attachments
asana-task-update.sh Apply reusable Asana task mutations
asana-create-dep-task.sh Create dependent Asana tasks
asana-whoami.sh Return current Asana identity
convention-sync.sh Sync ~/.cursor/ and edge-dev-agents in either direction, mirroring ~/.cursor/README.md to repo root README.md
generate-claude-md.sh Regenerate ~/.claude/CLAUDE.md from always-apply rules
tool-sync.sh Sync Cursor assets into OpenCode and Claude-compatible formats
port-to-opencode.sh Convert Cursor files into OpenCode-friendly mirrors

Shared Modules

Module Purpose
edge-repo.js Shared repo resolution, git wrappers, conflict detection, verification, and gh helpers for the pr-land pipeline

Rules (.mdc files)

Rule Purpose
workflow-halt-on-error.mdc Stop skill execution on script failures and fix the workflow definition first
load-standards-by-filetype.mdc Load language standards before editing or investigating file-specific issues
answer-questions-first.mdc Answer user questions before editing or mutating state
no-format-lint.mdc Avoid manual formatting and formatting-only lint work
typescript-standards.mdc TypeScript and React editing standards
review-standards.mdc Review-specific bug patterns and conventions
eslint-warnings.mdc Documented fixes for recurring ESLint warnings
after_each_chat.mdc Post-chat automation rule used in the local workflow

Design Principles

  1. Scripts over duplicated reasoning. Deterministic git, API, and parsing
    work belongs in shared scripts.
  2. gh over raw GitHub HTTP calls. Use the authenticated CLI for GitHub
    workflows.
  3. Shared helpers over drift. Reusable mechanics like autosquash and push
    should live in one script and be consumed by multiple skills.
  4. Rules before edits. Load the relevant standards before editing code or
    evaluating lint/type failures.
  5. Workflow fixes before workarounds. If a skill is wrong, fix the skill or
    script instead of patching around it in an ad-hoc way.
  6. Canonical local copy. ~/.cursor/ is the working source of truth;
    edge-dev-agents is the distribution and review copy.

j0ntz added 8 commits April 13, 2026 18:20
Document the current repo structure, workflow skills, and shared
scripts using the older conventions README format as a template.
task-review: resolve target repo by grepping code for concrete symbols,
not task text. Title/description demoted to hints; prefix table kept as
an exception shortcut; linked PRs short-circuit; cross-repo work splits
into Asana subtasks.

pr-create: drop all reviewer-assignment logic. Reviewer choice is a
human step; status-setting and review-hour estimation went with it.
--asana-attach remains.

one-shot: stop defaulting --asana-assign. --asana-attach only.

pr-land: add CHANGELOG placement warning handling so dated-release
entries can be moved to Unreleased/staging before pushing.
- New slot-fixup.sh: slot HEAD fixup next to its target's group (used by pr-address and bugbot after each lint-commit.sh).
- pr-finalize-fixups.sh: derive mode (autosquash | preserve) from the latest human activity on the PR; new squash-stale subcommand for the Fixups-A-before-B trigger; finalize action now push-only in preserve mode, autosquash+force-push in autosquash mode.
- pr-address review-mode subcommand: returns mode + latestHumanActivity for shared use.
- Simplified human-reviewer detection across pr-address and pr-land scripts: exclude only currentUser + bots (drop prAuthor exclusion). Works uniformly for solo and collab PRs — author gets no special treatment.
- pr-address and bugbot SKILL.md: new Step 1.5 (squash-stale before address-pass) and per-fixup slot-fixup.sh after every lint-commit.sh.
@j0ntz j0ntz changed the title Bootstrap edge-dev-agents with skills, rules, and scripts Jon's agent skills, rules, and scripts May 1, 2026
j0ntz added 2 commits May 1, 2026 13:43
- Pull-before-push gate: auto-fetch origin every run; abort --stage/--commit if origin is ahead.
- Per-file divergence warnings: compare each affected path's most-recent commit timestamp to the local file's mtime; flag stale-local, deletion, and re-adding-deleted cases.
- New JSON output fields: originBranch, originAhead, warnings.
- SKILL.md: present new warnings in the dry-run summary; document the new policy and edge cases.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Identified several concrete security issues in newly added workflow scripts/rules. Leaving inline comments on the affected lines only.

Open in Web View Automation 

Sent by Cursor Security Review Agent: Security Reviewer

Checkout the PR branch to ensure file reads reflect the PR's code, not the current local branch:

```bash
git fetch origin <headRef> && git checkout <headRef>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
<headRef> is inserted unquoted into a shell command (git fetch ... && git checkout ...) even though PR branch names are attacker-controlled input.

Impact: A crafted branch name containing shell metacharacters (for example command substitution) can execute arbitrary commands in the review agent environment.

Resolve the full 40-char SHA for the PR's head branch:

```bash
HEAD_SHA=$(git rev-parse origin/<BRANCH>)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
<BRANCH> is interpolated directly into git rev-parse origin/<BRANCH> in a shell command path that derives branch names from PR metadata.

Impact: Malicious branch names can trigger command injection during bugbot workflow execution, leading to arbitrary code execution in automation context.

IMPLEMENTOR_NAME="current user"

# Phase 3: Create the task
NOTES_JSON=$(python3 -c "import json; print(json.dumps('''$TASK_NOTES'''))")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
User/task-controlled content is embedded directly into inline Python source via triple-quoted interpolation ('''$TASK_NOTES''' / '''$TASK_NAME''') in python3 -c calls.

Impact: An input containing ''' can break out of the string literal and inject executable Python statements, resulting in code execution in the automation runtime.

ext = os.path.splitext(name)[1].lower()
if ext in DOWNLOAD_EXTS and url:
os.makedirs(download_dir, exist_ok=True)
dest = os.path.join(download_dir, name)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
Attachment filename name is treated as a trusted path segment via os.path.join(download_dir, name) before writing downloaded content.

Impact: Filenames containing traversal segments (for example ../) can write files outside the intended task download directory, enabling workspace boundary bypass and arbitrary file overwrite in reachable paths.


<rules>
<rule id="every-turn">Execute at the end of every chat turn without exception.</rule>
<rule id="full-response">Send the complete response content, not an abbreviated summary.</rule>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
[Privacy Guard] This rule mandates forwarding the complete chat response every turn to an external Telegram sink without user confirmation or selective minimization.

Impact: Sensitive content (credentials, proprietary code, internal data) can be exfiltrated outside the expected trust boundary by policy.

jq --arg k "$KEY" --arg v "$VALUE" '.[$k] = $v' env.json > env.json.tmp
mv env.json.tmp env.json

git add env.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
[Privacy Guard] The script stages and commits env.json updates after accepting raw secret values as direct inputs.

Impact: Secret material can become durable plaintext in git history and propagate through clones/backups, creating long-lived credential exposure risk.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Net-new security findings on current head after deduplication against prior automation comments and threads.

Open in Web View Automation 

Sent by Cursor Security Review Agent: Security Reviewer

if (!existsSync(path.join(repoDir, ".git"))) {
console.error(`Cloning ${repo}...`);
try {
execSync(`git clone git@github.com:EdgeApp/${repo}.git "${repoDir}"`, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
repo is interpolated into a shell command string passed to execSync (git clone git@github.com:EdgeApp/${repo}.git ...) without validation or argument separation.

Impact: A crafted repo value can trigger shell command injection and arbitrary code execution in the automation environment.


function fetchPrBody(repo, prNumber) {
const endpoint = `repos/EdgeApp/${repo}/pulls/${prNumber}`;
const result = execSync(`gh api "${endpoint}" --jq '.body'`, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
fetchPrBody() builds a shell command string with untrusted repo (gh api "repos/EdgeApp/${repo}/pulls/${prNumber}" ...) and executes it via execSync.

Impact: Malicious input can exploit shell expansion and execute arbitrary commands while extracting PR metadata.

COMMIT_MSG="Update $KEY in env.json"
fi

ssh "$SERVER" bash -s -- "$KEY" "$VALUE" "$COMMIT_MSG" "$REMOTE_REPO" <<'REMOTE'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: MEDIUM
The secret value is passed as a positional CLI argument ("$VALUE") into ssh ... bash -s -- ..., which exposes it in process arguments and often shell history.

Impact: Sensitive credentials can be disclosed to local observers or process-monitoring tooling on the calling host.

Re-validate eslint after update-eslint-warnings runs; if the staged
config fails lint (e.g. a naive graduation of a still-dirty file),
restore eslint.config.mjs and abort. With this safety net in place,
/pr-land's --skip-lint patch (e21dca8) is no longer needed — revert
verify-repo.sh, pr-land-{prepare,merge}.sh, edge-repo.js, SKILL.md
back to file-scoped lint.

Also fixes pr-land-discover.sh's reviewer-state computation: only
APPROVED/CHANGES_REQUESTED/DISMISSED change effective state, so a
later COMMENTED reply doesn't shadow a prior APPROVED.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Net-new security findings on current head after module triage, severity filtering, and duplicate suppression against existing automation threads/comments.

Open in Web View Automation 

Sent by Cursor Security Review Agent: Security Reviewer


function checkNpmPublished(packageName, version) {
try {
const info = execSync(`npm view ${packageName}@${version} version`, {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
checkNpmPublished builds an execSync shell string using packageName and version from package.json (npm view ${packageName}@${version} version) without argument-safe execution.

Impact: A crafted package name/version can trigger command injection and arbitrary code execution in automation environments running this publish flow.

const fileCount = changedFiles.split("\n").length;
console.log(`▶ eslint (${fileCount} changed file${fileCount === 1 ? "" : "s"} vs ${baseRef})...`);
const eslintResult = runCommandWithLog(
`npx eslint ${fileList}`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
verify-repo.sh builds an eslint command string from git-derived filenames and executes it via execSync; wrapping paths in quotes is not sufficient shell escaping.

Impact: A malicious filename in a branch can break command quoting and execute arbitrary shell commands during repository verification.

"skills",
"verify-repo.sh"
);
const baseArg = baseRef != null ? ` --base "${baseRef}"` : "";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
runVerification/related helpers interpolate derived repo/path values into execSync shell strings instead of passing argument arrays.

Impact: If attacker-influenced repo/path metadata reaches these call sites, command injection can occur during pr-land preparation/verification operations.

</sub-step>
</step>

<step id="4" name="Upload to gist and clean up">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
The standup workflow templates externally sourced task/PR text directly into markdown and then requires uploading the rendered output to a persistent GitHub gist, without a mandatory scrub/redaction step.

Impact: Sensitive code-adjacent content (paths, snippets, internal details) from source systems can be durably exfiltrated to an external artifact.

Comment thread .cursor/commands/hudl.md
</sub-step>
</step>

<step id="4" name="Upload to gist and clean up">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
The HUDL flow maps GitHub-derived PR text fields into a generated markdown report and uploads it to a gist, but does not require sanitization/minimization of potentially sensitive content.

Impact: Code-related or sensitive operational details can leak into externally stored summaries.

# Copy file only if changed, respecting --dry-run
sync_file() {
local src="$1" dest="$2"
if [[ ! -f "$dest" ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
sync_file copies directly to destination paths without rejecting symlink destinations or enforcing canonical containment.

Impact: A pre-positioned symlink under the sync tree can redirect writes to unintended files, enabling arbitrary file overwrite as the current user.

for oc_skill_dir in "$OPENCODE_DIR"/skills/*/; do
[[ -d "$oc_skill_dir" ]] || continue
local name
name=$(basename "$oc_skill_dir")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH
Cleanup uses rm -rf on globbed skill directories without symlink validation.

Impact: A symlinked directory entry can cause deletion outside the intended sync root, leading to destructive data loss in attacker-chosen paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant